﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aliphant.Widget.Calendar.Models
{
    public class CalenderMonth
    {
        public CalenderMonth(DateTime date)
        {
            this.Days = DateTime.DaysInMonth(date.Year, date.Month);
            this.FirstDayWeek = ((int)date.DayOfWeek + 7 - (date.Day % 7)) % 7 + 1;
            this.Month = date.Month;
            this.Year = date.Year;
        }

        /// <summary>
        /// 当月天数
        /// </summary>
        public int Days { get; set; }

        /// <summary>
        /// 1号的星期
        /// </summary>
        public int FirstDayWeek { get; set; }

        /// <summary>
        /// 月份
        /// </summary>
        public int Month { get; set; }

        /// <summary>
        /// 年份
        /// </summary>
        public int Year { get; set; }
    }

    /// <summary>
    /// 日期
    /// </summary>
    public class CalenderDay
    {
        /// <summary>
        /// 是否是今天
        /// </summary>
        public bool Today { get; set; }

        /// <summary>
        /// 是否是月第一天
        /// </summary>
        public bool FirstDay {  get; set; }

        /// <summary>
        /// 是否是月最后一天
        /// </summary>
        public bool LastDay { get;set; }

        /// <summary>
        /// 上个月的日期
        /// </summary>
        public bool LastMonth {  get; set; }

        /// <summary>
        /// 下个月的日期
        /// </summary>
        public bool NextMonth { get; set; }

        /// <summary>
        /// 日期
        /// </summary>
        public int Day { get; set; }

        /// <summary>
        /// 星期
        /// </summary>
        public int Week { get; set; }

        /// <summary>
        /// 月份
        /// </summary>
        public int Month { get; set; }

        /// <summary>
        /// 年份
        /// </summary>
        public int Year { get; set; }
    }
}
